package com.tsingsoft.wslogs.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * ========================
 *
 * @author bask
 * @Description: TODO
 * @date : 2021/1/8 16:58
 * Version: 1.0
 * ========================
 */
@Controller
@RequestMapping("/logs")
@Slf4j
public class LogsController {

    @Value("${my.ws_host:localhost}")
    private String wsHost;

    @Value("${server.port:9999}")
    private String port;

    @RequestMapping({"/index"})
    public ModelAndView index() {
        log.debug("print >>> index view");
        ModelAndView view = new ModelAndView();
        view.setViewName("logs/index");
        view.addObject("ws_host",wsHost);
        view.addObject("port",port);

        return view;
    }

    @RequestMapping({"/work"})
    public ModelAndView work() {
        log.debug("print >>> work view");
        ModelAndView view = new ModelAndView();
        view.setViewName("thread/index");
        view.addObject("ws_host",wsHost);
        view.addObject("port",port);
        return view;
    }
}
